package com.hkemmm.control;

import com.hkemmm.bean.UserInfoBean;
import com.hkemmm.service.ILoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

@Controller("loginControl")
public class LoginControl {
    @Resource
    UserInfoBean userInfoBean;
    @Resource(name = "loginService")
    ILoginService iloginService;


    public boolean doLogin(){
        boolean canLogined = false;

        canLogined = iloginService.doLogin(userInfoBean);

        System.out.println("-------------------------");
        iloginService.show();
        return canLogined;
    }

    public UserInfoBean getUserInfoBean() {
        return userInfoBean;
    }

    public void setUserInfoBean(UserInfoBean userInfoBean) {
        this.userInfoBean = userInfoBean;
    }

    public ILoginService getIloginService() {
        return iloginService;
    }

    public void setIloginService(ILoginService iloginService) {
        this.iloginService = iloginService;
    }
}
